<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>商城</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
		<link rel="stylesheet" href="<%=request.getContextPath() %>/resources/css/shoppingcart.css">
	    <link rel="stylesheet" href="<%=request.getContextPath() %>/resources/bootstrap/css/bootstrap.min.css">
	    <script src="<%=request.getContextPath() %>/resources/jquery/jquery-1.11.3.min.js"></script>
		<script src="<%=request.getContextPath() %>/resources/bootstrap/js/bootstrap.min.js"></script>
	 	<script type="text/javascript" src="https://unpkg.com/wangeditor/release/wangEditor.min.js"></script>
		<script src="<%=request.getContextPath() %>/resources/js/shoppingcart.js"></script>		
				<link href="<%=request.getContextPath() %>/resources/img/tea.png" rel="icon">
			
  </head>
<!--   background-color:rgba(193, 247, 176, 0.466)
 --> <body style="background-image: linear-gradient(to top, #fff,#30A12B); height:965px;">
 <div class="container-fluid">
<input id="usersequence" type="text" value='<%=session.getAttribute("usersequence") %>' hidden>
<input id="nickname" type="text" value='<%=session.getAttribute("nickname") %>' hidden>

	<jsp:include page="/WEB-INF/jsp/menu.jsp" />
	<div class="row ">
	<c:choose>
		<c:when test="${not empty list }">
	    <table class="table table-striped table-hover">
			<thead>
				<tr>
					<th>购物车订单号</th>
	                <th>商品号</th>
	                <th>商品名称</th>
	               <!--  <th>图片</th> -->
	                <th>操作</th>
            	</tr>
			</thead>
			<tbody>
				<c:forEach items="${list }" var="lis" varStatus="vs">
				  	<tr>
				  		<td>${lis.shopcartId }</td>
				  		<td>${lis.teaId }</td>
				  		<td>${lis.teaname }</td>
				  		<%-- <td >${lis.teaImg }</td> --%>
				  		<td><button class="btn btn-warning"><a href="${lis.url}">购买</a></button>
				  		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="移出购物车" class="btn btn-danger" onclick="remove(${lis.shopcartId})" /></td>
				  	</tr>
				</c:forEach>
			</tbody>
		</table>
		</c:when>
	</c:choose>
</div>
 <!-- 分页功能 start -->
	<div align="center">
		<font size="2">共 ${page.totalPageCount} 页</font> <font size="2">第
			${page.pageNow} 页</font> <a href="/TeaCulture/shoppingcart?pageNow=1">首页</a>
		<c:choose>
			<c:when test="${page.pageNow - 1 > 0}">
				<a href="/TeaCulture/shoppingcart?pageNow=${page.pageNow - 1}">上一页</a>
			</c:when>
			<c:when test="${page.pageNow - 1 <= 0}">
				<a href="/TeaCulture/shoppingcart?pageNow=1">上一页</a>
			</c:when>
		</c:choose>
		<c:choose>
			<c:when test="${page.totalPageCount==0}">
				<a href="/TeaCulture/shoppingcart?pageNow=${page.pageNow}">下一页</a>
			</c:when>
			<c:when test="${page.pageNow + 1 < page.totalPageCount}">
				<a href="/TeaCulture/shoppingcart?pageNow=${page.pageNow + 1}">下一页</a>
			</c:when>
			<c:when test="${page.pageNow + 1 >= page.totalPageCount}">
				<a href="/TeaCulture/shoppingcart?pageNow=${page.totalPageCount}">下一页</a>
			</c:when>
		</c:choose>
		<c:choose>
			<c:when test="${page.totalPageCount==0}">
				<a href="/TeaCulture/shoppingcart?pageNow=${page.pageNow}">尾页</a>
			</c:when>
			<c:otherwise>
				<a href="/TeaCulture/shoppingcart?pageNow=${page.totalPageCount}">尾页</a>
			</c:otherwise>
		</c:choose>
	</div> 
<!-- *************************************-->
 <%-- <div class="container">
    <div class="row pad-15">
        <div class="col-md-12">
            <nav class="pagination-outer" aria-label="Page navigation">
                <ul class="pagination">
                 <li class="page-item"><a class="page-link" href="/TeaCulture/shoppingcart?pageNow=1">首页</a></li>
                    <li class="page-item">
                        <a href="/TeaCulture/shoppingcart?pageNow=1" class="page-link" aria-label="Previous">
                            <span aria-hidden="true">«</span>
                        </a>
                    </li>
                   
                    <li class="page-item"><a class="page-link" href="#">共</a></li>
                    <li class="page-item active"><a class="page-link" href="#">${page.totalPageCount}</a></li>
                    <li class="page-item"><a class="page-link" href="#">页</a></li>
                    
                    <li class="page-item">
                        <a href="/TeaCulture/shoppingcart?pageNow=${page.pageNow}" class="page-link" aria-label="Next">
                            <span aria-hidden="true">»</span>
                        </a>    </li>
                         <li class="page-item"><a class="page-link" href="#">第</a></li>
                    <li class="page-item active"><a class="page-link" href="#">${page.pageNow}</a></li>
                    <li class="page-item"><a class="page-link" href="#">页</a></li>
                        <li class="page-item"><a class="page-link" href="/TeaCulture/shoppingcart?pageNow=${page.totalPageCount}">尾页</a></li>
                
                </ul>
            </nav>
        </div>
    </div>
</div> --%>
 <!-- *************************************-->
 
 </div>
  </body>
  
</html>
